<div class="model_actions_toolbar">
    <?php $this->widget('backend.components.ModelActions'); ?>
</div>

<?php
echo CHtml::beginForm(array('users/delete'), 'post', array(
    'onSubmit' => "return fnOnSubmitDeleteConfirm('" . CHtml::encode(Yii::t('jsmsg', 'confirm_delete')) . '\',\'' . Yii::t('jsmsg', 'unselect_tips') . "');"
));
?>
<table border="0" width="100%" cellpadding="0" cellspacing="0" class="datas_grid">
    <thead>
        <tr>
            <th><input type="checkbox" id="checkallboxs" onclick="$('input[name=\'delete[]\']').attr('checked', this.checked);" /></th>
            <th><?php echo $sort->link('group_id'); ?></th>
            <th><?php echo $sort->link('username'); ?></th>
            <th><?php echo $sort->link('status'); ?></th>
            <th><?php echo $sort->link('created'); ?></th>
            <th><?php echo $sort->link('updated'); ?></th>
            <th></th>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td>
                <?php
                echo CHtml::imageButton(Yii::app()->baseUrl . '/assets/backend/images/action_delete.png');
                ?>
            </td>
            <td colspan="8">
                <?php $this->widget('CLinkPager', array('pages' => $pages)); ?>
            </td>
        </tr>
    </tfoot>
    <tbody>
        <?php foreach($models as $n => $model): ?>
        <tr class="<?php echo ($n % 2) ? 'even' : 'odd'; ?>">
            <td class="sn_and_checkbox">
                <input type="checkbox" name="delete[]" value="<?php echo $model->id; ?>">
                <?php echo CHtml::link(sprintf("%02d", ++$n + $pages->getCurrentPage() * $pages->getPagesize()), array('show', 'id' => $model->id)); ?>
            </td>
            <td><?php // echo $model->group->name; ?></td>
            <td><?php echo CHtml::encode($model->username); ?></td>
            <td><?php echo $model->statusAjaxLink; ?></td>
            <td class="date"><?php echo date('Y-m-d', $model->created); ?></td>
            <td class="date"><?php echo $model->updatedFormatted; ?></td>
            <td class="action_one">
                <?php
                echo CHtml::link(CHtml::image(Yii::app()->baseUrl . '/assets/backend/images/icon/icon_password.png'),
                    array('changePassword', 'id' => $model->id)
                );
                ?>
            </td>
        </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<?php echo CHtml::endForm(); ?>
